//
//  JSONUtil.m
//  RedballBar
//
//  Created by Faith on 2023/7/4.
//

#import "JSONUtil.h"

@implementation JSONUtil

+ (NSString *)stringify:(id)object {
    NSData *data = [NSJSONSerialization dataWithJSONObject:object options:0 error:NULL];
    return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
}

+ (id)parse:(id)data {
    id object = [NSJSONSerialization JSONObjectWithData:[[NSData alloc] initWithData:[data dataUsingEncoding:NSUTF8StringEncoding]] options:0 error:nil];
    return [HttpRequest processDictionary:object];
}

@end
